#pragma once

#include "IMsgSink.h"

class CFrame:public SingletonT<CFrame>
{
public:
	CFrame();
	~CFrame();

	HWND Create(const char* pName);

	HWND GetWindow();

	void MsgLoop();

	static void SetMsgSink(IMsgSink* pMsgSink);

	operator HWND ();

	static LRESULT __stdcall WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

private:
	HWND m_hWnd;
	static IMsgSink* m_pMsgSink;
	const static __int64 m_msgLoopInterval = 100;
};
